package com.twu.biblioteca;

import java.util.ArrayList;

public class Collection {

    private ArrayList<Book> bookList;
    private ArrayList<Movie> movieList;

    public Collection() {

        bookList = new ArrayList<Book>();
        bookList.add(new Book("A"));
        bookList.add(new Book("B"));
        bookList.add(new Book("C"));

        movieList = new ArrayList<Movie>();
        movieList.add(new Movie("A", 1981, "P", 1));
        movieList.add(new Movie("B", 1982, "Q", 2));
        movieList.add(new Movie("C", 1983, "R", 3));
        movieList.add(new Movie("D", 1984, "S", 4));
        movieList.add(new Movie("E", 1985, "T", 5));
        movieList.add(new Movie("F", 1986, "U", 6));
        movieList.add(new Movie("G", 1987, "V", 7));
        movieList.add(new Movie("H", 1988, "W", 8));
        movieList.add(new Movie("I", 1989, "X", 9));
        movieList.add(new Movie("J", 1990, "Y", 10));
        movieList.add(new Movie("K", 1991, "Z", 0));
        movieList.add(new Movie("L", 1992, "AA", 0));
        movieList.add(new Movie("M", 1993, "AB", 0));
        movieList.add(new Movie("N", 1994, "AC", 0));
        movieList.add(new Movie("O", 1995, "AD", 0));
    }

    public Book getBookFromList(int index) {
        return bookList.get(index);
    }

    public String bookListString() {
        String bookListString = "";
        for (int i = 0; i < bookList.size(); i++) {
            bookListString += (i + 1) + ". " + bookList.get(i).getName() + '\n';
        }
        return bookListString;
    }

    public String movieListString() {
        String movieListString = "";
        for (int i = 0; i < movieList.size(); i++) {
            movieListString += movieList.get(i).toString() + '\n';
        }
        return movieListString;
    }
}